import pandas as pd

# 读取Excel文件
# 修改为原始字符串路径
df = pd.read_excel(r"C:\Users\admin\Documents\WXWork\1688854687595633\Cache\File\2025-03\331上线品牌、车型、版本、价格.xlsx")

# 假设这是你的Excel数据结构
# '车系' -> model_name, '区间价' -> price_range, '车型配置版本（前端展示）' -> version_name, '官方指导价' -> price

model_insert_statements = []
version_insert_statements = []

for index, row in df.iterrows():
    # 对于zl_model表的mock数据
    model_id = index + 1  # 假设model_id按顺序递增
    model_data = {
        "model_name": row['车系'],
        "price_range": row['区间价'],
        # 添加其他需要mock的字段
    }
    model_insert_stmt = f"INSERT INTO `zl_model` (`model_id`, `model_name`, `price_range`, ...) VALUES ('{model_data['model_name']}', '{model_data['price_range']}', ...);"
    model_insert_statements.append(model_insert_stmt)
    
    # 对于zl_model_version表的mock数据
    version_data = {
        "model_id": model_id,
        "version_name": row['车型配置版本（前端展示）'],
        "price": row['官方指导价'],
        # 添加其他需要mock的字段
    }
    version_insert_stmt = f"INSERT INTO `zl_model_version` (`model_id`, `version_name`, `price`, ...) VALUES ({version_data['model_id']}, '{version_data['version_name']}', {version_data['price']}, ...);"
    version_insert_statements.append(version_insert_stmt)

# 输出或执行这些SQL语句
for stmt in model_insert_statements:
    print(stmt)
for stmt in version_insert_statements:
    print(stmt)